import Http from '../../http';
import { loginModel } from '../../../types/user'

export const login = function(loginForm:loginModel) {
    return Http.post('/login/login', loginForm);
}
export const captcha = function() {
    return Http.get('/login/CaptchaImage');
}

export const loginOut = function() {
    return Http.get('/login/LoginOut');
}

export const userInfo = function() {
    return Http.get('/login/getuserinfo') 
}

export const userChangeInfo = function() {
    return Http.get('/user/UserChange') 
}

export const upuserInfo = function(user:any) {
    return Http.put('/user/UserChangePost',user) 
}

//列表部门列表树
export const getDeptListTree = function() {
    return Http.get('/user/DeptListTree') 
}

export const getList = function(queryModel:any) {
    return Http.get('/user/list',queryModel) 
}


export const getEdit = function(id:number) {
    return Http.get('/user/AddOrEdit',{id:id}) 
}
export const postAdd = function(from:any) {
    return Http.post('/user/Create',from) 
}
export const putEdit = function(from:any) {
    return Http.put('/user/Edit',from) 
}
export const delOne = function(id:number) {
    return Http.delete('/user/Delete',{id:id}) 
}

//编辑用户状态
export const chStatus = function(form:any) {
    return Http.put('/user/ChStatus',form) 
}